split string into groups of 3 chars python

40

s = '1234567890'
o = []
while s:
    o.append(s[:2])
    s = s[2:]

Comments

Submit
0 Comments